package com.ax.associator.storeDoctor.service.serviceImpl;

import com.ax.associator.store.common.utils.PageUtils;
import com.ax.associator.store.common.utils.Query;
import com.ax.associator.storeDoctor.dao.BaseDoctorMapper;
import com.ax.associator.storeDoctor.dao.RemoteInquiryMapper;
import com.ax.associator.storeDoctor.domain.BaseDoctor;
import com.ax.associator.storeDoctor.domain.DoctorUserDto;
import com.ax.associator.storeDoctor.service.BaseDoctorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

import static java.lang.Long.valueOf;

@Service
public class BaseDoctorServiceImpl implements BaseDoctorService{

    @Autowired
    private BaseDoctorMapper baseDoctorMapper;

    @Autowired
    private RemoteInquiryMapper remoteInquiryMapper;


    @Override
    public List<DoctorUserDto> queryDoctor(Map<String,Object> map) {

        List<DoctorUserDto> list=baseDoctorMapper.queryDoctor(map);
        for(DoctorUserDto li:list){
            Integer no= remoteInquiryMapper.queryNo(li.getDoctorId());
            li.setNo(no);
        }
        return list;
    }

    @Override
    public List<DoctorUserDto> queryDoctorDetails(Map<String, Object> map) {
        List<DoctorUserDto> list=baseDoctorMapper.queryDoctorDetails(map);
        for(DoctorUserDto li:list){
            Integer no= remoteInquiryMapper.queryNo(li.getDoctorId());
            li.setNo(no);
        }
        return list;
    }
}
